# -*- coding: utf-8 -*-
# @Time : 2022/4/9 20:00
# @Author : Liuqing
# @File : 07_首字母大写.py
# @Software : PyCharm

s = 'python is a good program language'
print(s.title())


# 改进，小于或等于两个字符的首字母不大写
def first_letter_upper(string):
    words = string.split()
    words = [word.capitalize() if len(word) > 2 else word for word in words]
    return " ".join(words)


if __name__ == '__main__':
    print(first_letter_upper(s))
